package com.sale.goods.dubbo;

import com.sale.goods.api.RemoteGoodsPaymentService;
import com.sale.goods.api.dto.GoodsMessageBySupplierDto;
import com.sale.goods.service.IGoodsPaymentService;
import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 付款单dubbo服务
 */
@RequiredArgsConstructor
@DubboService
@Service
public class RemoteGoodsPaymentServiceImpl implements RemoteGoodsPaymentService {

    private final IGoodsPaymentService goodsPaymentService;

    /**
     * 根据供应商分组获取已核销金额、整单折扣
     * @return
     */
    @Override
    public Map<String, GoodsMessageBySupplierDto> getGoodsMessageBySupplier() {
        return goodsPaymentService.getGoodsMessageBySupplier();
    }

    /**
     * 工作台接口(采购已收款金额)
     */
    @Override
    public String received() {
        return goodsPaymentService.goodsReceived();
    }

    /**
     * 工作台接口(采购未付款金额)
     */
    @Override
    public String arrears() {
        return goodsPaymentService.goodsArrears();
    }
}
